import { Table } from 'antd'
import type { TableProps } from 'antd'

interface DataType {
  key: number;
  name: string;
  age: number;
  gender: string;
  date: string;
}

const columns: TableProps<DataType>['columns'] = [
  {
    title: 'Name',
    dataIndex: 'name',
  },
  {
    title: 'Age',
    dataIndex: 'age',
  },
  {
    title: 'Gender',
    dataIndex: 'gender',
  },
  {
    title: 'Date',
    dataIndex: 'date',
  },
]

const data: DataType[] = [
  {
    key: 1,
    name: '阿台',
    age: 3,
    gender: '女',
    date: '2021-04-18',
  },
  {
    key: 2,
    name: '阿灶',
    age: 2,
    gender: '男',
    date: '2022-04-12',
  },
]

export default function About() {
  return (
    <>
      <Table
        columns={columns}
        dataSource={data}
        bordered
        title={() => '这是列表头部'}
        footer={() => '这是列表尾部'}
      />
    </>
  )
}
